<%@ Control language="vb" Inherits="YourCompany.Modules.TCDevGFCAuth.ViewTCDevGFCAuth" CodeFile="ViewTCDevGFCAuth.ascx.vb" AutoEventWireup="false" Explicit="True" %>
<%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/ModuleAuditControl.ascx" %>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript" src="http://www.google.com/friendconnect/script/friendconnect.js"></script>
    <script type="text/javascript">
        function init(times) { }

        function onInitPage(st) { }

        function onFriendConnectInitialized(st) {
            if (!window.friendconnect_times_loaded) {
                window.friendconnect_times_loaded = 1;
            } else {
                window.friendconnect_times_loaded++;
            }
            init(window.friendconnect_times_loaded);
            onInitPage(st);
        }

        function onAjaxLoaded() {
            google.friendconnect.container.setParentUrl("/");
            google.friendconnect.container.loadOpenSocialApi({
            site: "05395227795150688811",
                onload: onFriendConnectInitialized
            });
        }

        function addFCLoginButton() {
            google.friendconnect.renderSignInButton({
                "id": "login",
                "text": "Sign in with Google Friend Connect",
                "style": "long"
            });
        }

        function renderMembersGadget(divId, siteId) {
            var skin = {};
            skin['ENDCAP_BG_COLOR'] = '#eee';
            skin['ENDCAP_LINK_COLOR'] = '#36b';
            skin['CONTENT_LINK_COLOR'] = '#36b';
            skin['CONTENT_SECONDARY_LINK_COLOR'] = '#36b';

            skin['HEIGHT'] = '385';
            skin['BORDER_COLOR'] = '#cccccc';
            skin['ENDCAP_TEXT_COLOR'] = '#333333';
            skin['ALTERNATE_BG_COLOR'] = '#ffffff';
            skin['CONTENT_BG_COLOR'] = '#ffffff';
            skin['CONTENT_TEXT_COLOR'] = '#333333';
            skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
            skin['CONTENT_HEADLINE_COLOR'] = '#333333';
            google.friendconnect.container.renderMembersGadget(
   { id: divId,
       site: siteId
   },
    skin);
        }

        function addFCViewFriendsButton() {
            google.friendconnect.renderSignInButton({
            "id": "logged",
                "text": "View your friends on this site",
                "style": "standard"
            });
        }
        function setInit(url) {
            window.init = function(times) {
                if (times > 1) {
                    window.top.location.href = url;
                }
            };
        }
    
    </script>

     
  <script type="text/javascript">
      google.load("jquery", "1.3.1");
      google.load('friendconnect', '0.8', {
          'base_domain': 'www.google.com'
      });

      google.setOnLoadCallback(onAjaxLoaded);
      window.onInitPage = function(st) {
          addFCLoginButton();
      }
  </script>
<asp:Label ID="lblError" runat="server" />
  <%If currentuser Is Nothing Then%>
  <div id="login">Loading...</div>
  <%Else %>
  <div id="logged">        
  <img src="<%=currentUser.Image%>" class="thumbnailurl" />
        <%="Hi " + currentUser.Name%>
        <%  If fcAuthToken <> "" Then%>
        | <a href="javascript:void(0);" onclick="google.friendconnect.requestSettings();">Settings</a> 
        | <a href="javascript:void(0);" onclick="google.friendconnect.requestInvite();">Invite friends</a>
        | <a href="members.aspx">Members</a>            
        | <a href="logout.aspx">Sign out</a>
       <%End If%>
 </div>    
<%end if %>
   

         